function pxReize(px: number) {
  return (px * document.documentElement.clientWidth) / 1680;
}

export function getOption2() {
  return {
    grid: {
      left: pxReize(20),
      top: pxReize(60),
      bottom: pxReize(10),
      right: pxReize(10),
      containLabel: true,
    },
    legend: {
      top: pxReize(36),
      textStyle: {
        color: 'rgba(255,255,255,.6)',
      },
      data: [{
        name: "android",
      }, {
        name: "ios",
      }]
    },
    title: {
      text: "模块标题样式",
      textStyle: {
        color: "#fff",
        fontSize: pxReize(16),
      },
    },
    xAxis: {
      boundaryGap: false, // 坐标轴刻度从起点开始
      data: new Array(20).fill("").map((v, i) => {
        return (i + 1).toString().padStart(2, "0");
      }),
      axisLine: {
        show: false,
      },
      axisLabel: {
        show: true,
        fontSize: pxReize(10),
        color: "rgba(255,255,255,.7)",
      },
      axisTick: {
        show: true,
      },
    },
    yAxis: {
      axisLine: {
        show: true,
        lineStyle: {
          color: "rgba(255,255,255,.1)",
        },
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
        },
      },
      axisLabel: {
        color: "rgba(255,255,255,.7)",
        show: true,
        fontSize: pxReize(12),
      },
    },
    series: [
      {
        name: "android",
        type: "line",
        data: [
          3, 4, 3, 4, 3, 4, 3, 6, 2, 4, 2, 4, 3, 4, 3, 4, 3, 4, 3, 6, 2, 4, 2,
        ],
        smooth: true,
        lineStyle: {
          color: "#02a6b5",
        },
        areaStyle: {
          color: {
            // 线性渐变
            type: "linear",
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [
              {
                offset: 0,
                color: "rgba(255,255,255,.04)", // 0% 处的颜色
              },
              {
                offset: 1,
                color: "rgba(255,255,255,.1)", // 100% 处的颜色
              },
            ],
            global: false, // 缺省为 false
          },
        },
        symbol: "none",
      },
      {
        name: "ios",
        type: "line",
        data: [
          5, 3, 5, 6, 1, 5, 3, 5, 6, 4, 6, 4, 8, 3, 5, 6, 1, 5, 3, 7, 2, 5, 1,
        ],
        smooth: true,
        lineStyle: {
          color: "#22ad29",
        },
        areaStyle: {
          color: {
            // 线性渐变
            type: "linear",
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [
              {
                offset: 0,
                color: "rgba(255,255,255,.04)", // 0% 处的颜色
              },
              {
                offset: 1,
                color: "rgba(255,255,255,.1)", // 100% 处的颜色
              },
            ],
            global: false, // 缺省为 false
          },
        },
        symbol: "none",
      },
    ],
  };
}
